export default {
	data() {
		return {
			list: [],
			page: -1,
			status: 'loadmore',
			
			emptyShow: false,
		}
	},
	methods: {
		setData(res) {
			if (res.data.last) {
				this.status = 'nomore';
			} else {
				this.status = 'loadmore';
			}
			this.page = res.data.number;
			if (this.page === 0) {
				this.list = res.data.content;
				if (this.list.length === 0) {
					this.emptyShow = true;
				}
			} else {
				this.list = this.list.concat(res.data.content);
			}
		},
		
		loadMore() {
			if (this.status === 'nomore') {
				return;
			}
			this.status = 'loading';
			this.getList(this.page);
		},
	}
}
